﻿<%@ Page Title="Order's editor" Language="C#" Theme="Admin" MasterPageFile="~/Admin.master"
    AutoEventWireup="true" CodeFile="AEditOrder.aspx.cs" Inherits="Pages_AEditOrder" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="PageStyle" style="width: 100%">
        <div class="Content">
            <div class="HeaderStyle">
                <span class="Title1">Order's editor</span>
                <div class="HeadLine">
                </div>
            </div>
            <div class="FormStyle">
                <div class="MsgError">
                    <asp:CustomValidator ID="cval" runat="server" ValidationGroup="OrderCate" Display="Dynamic"
                        CssClass="MsgError"> </asp:CustomValidator>
                </div>
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            Đơn hàng
                        </td>
                        <td class="c1empty">
                        </td>
                        <td>
                            <asp:Label ID="Label1" runat="server" CssClass="TextView"></asp:Label>
                        </td>
                        <td class="c3empty">
                        </td>
                        <td>
                            Khách hàng
                        </td>
                        <td class="c1empty">
                        </td>
                        <td>
                            <asp:Label ID="Label2" runat="server" CssClass="TextView"></asp:Label>
                        </td>
                    </tr>
                    <tr class="r1empty">
                        <td colspan="7">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Bắt đầu
                        </td>
                        <td class="c1empty">
                        </td>
                        <td>
                            <asp:Label ID="Label3" runat="server" CssClass="TextView"></asp:Label>
                        </td>
                        <td class="c3empty">
                        </td>
                        <td>
                            Kết thúc
                        </td>
                        <td class="c1empty">
                        </td>
                        <td>
                            <asp:Label ID="Label4" runat="server" CssClass="TextView"></asp:Label>
                        </td>
                    </tr>
                    <tr class="r1empty">
                        <td colspan="7">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Trạng thái
                        </td>
                        <td class="c1empty">
                        </td>
                        <td>
                            <asp:DropDownList ID="dlStatus" runat="server">
                                <asp:ListItem Text="Waiting" Value="Waiting"></asp:ListItem>
                                <asp:ListItem Text="Processing" Value="Processing"></asp:ListItem>
                                <asp:ListItem Text="Finished" Value="Finished"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td class="c3empty">
                        </td>
                        <td>
                        </td>
                        <td class="c1empty">
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
                <div class="r1empty">
                </div>
                <div>
                    <a href='<%= "AViewShipment.aspx?oid="+ OrderID %>' target="iViewShip"
                        onclick='javascript:$("#myviewer").Popup("show");'>Shipment</a>
                    <a href='<%= "AViewPayment.aspx?oid="+ OrderID %>'
                        target="iViewPay" onclick='javascript:$("#myviewer2").Popup("show");'>Payment</a></div>
                <div class="r1empty">
                </div>
                <asp:GridView ID="gv" GridLines="None" runat="server" AutoGenerateColumns="False"
                    DataKeyNames="DeID" CellPadding="0" AllowPaging="True" CssClass="GridStyle" AllowSorting="True"
                    EnableModelValidation="True" OnRowDataBound="gv_RowDataBound" OnRowUpdating="clickUpdateItem"
                    OnPageIndexChanging="gv_PageIndexChanging" PageSize="5">
                    <Columns>
                        <asp:TemplateField HeaderText="Mã sản phẩm">
                            <ItemTemplate>
                                <%# Eval("ProID")%>
                            </ItemTemplate>
                            <ItemStyle CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="T&#234;n">
                            <ItemTemplate>
                                <%# Eval("TEN")%>
                            </ItemTemplate>
                            <ItemStyle CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Số lượng">
                            <ItemTemplate>
                                <%# Eval("SoLuong") %>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Gi&#225;">
                            <ItemTemplate>
                                <%# (int.Parse(Eval("GIA").ToString())).ToString("$#,#", myInfo)%>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Th&#224;nh tiền">
                            <ItemTemplate>
                                <%#  (int.Parse(Eval("ThanhTien").ToString())).ToString("$#,#", myInfo)%>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Trạng th&#225;i">
                            <ItemTemplate>
                                <asp:DropDownList ID="dlSta" runat="server">
                                    <asp:ListItem Text="Waiting" Value="Waiting"></asp:ListItem>
                                    <asp:ListItem Text="Processing" Value="Processing"></asp:ListItem>
                                    <asp:ListItem Text="Finished" Value="Finished"></asp:ListItem>
                                </asp:DropDownList>
                            </ItemTemplate>
                            <ItemStyle CssClass="RowCell" />
                            <HeaderStyle Width="100px" CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="btUpdate" runat="server" CommandName="Update" CommandArgument='<%# Eval("DeID")%>'
                                    Text="Cập nhật"></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" Width="100px" />
                        </asp:TemplateField>
                    </Columns>
                    <RowStyle CssClass="GridRow" />
                    <AlternatingRowStyle CssClass="GridAltRow" />
                    <HeaderStyle CssClass="GridHeader" />
                    <FooterStyle CssClass="GridFooter" />
                    <PagerStyle CssClass="GridPager" />
                    <PagerSettings PageButtonCount="5" />
                </asp:GridView>
                <div class="r1empty">
                </div>
                <div style="text-align: right; font-weight: bold;">
                    <asp:Label ID="Label20" Text="Tổng tiền : " runat="server">
                        <asp:Label ID="Label21" runat="server"></asp:Label></asp:Label></div>
                <div class="r1empty">
                </div>
                <div class="ButtonStyle">
                    <asp:Button ID="btSave" runat="server" Text="Update" CausesValidation="true" ValidationGroup="editOrder"
                        OnClick="clickUpdateOrder" />
                </div>
            </div>
            <div class="FooterStyle">
            </div>
        </div>
        <div id="myviewer">
            <iframe frameborder="0" scrolling="no" marginheight="0" width="350" height="380"
                marginwidth="0" name="iViewShip"></iframe>
        </div>
        
        <div id="myviewer2">
            <iframe frameborder="0" scrolling="no" marginheight="0" width="250px" height="340px"
                marginwidth="0" name="iViewPay"></iframe>
        </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function ()
        {
            $("#myviewer").Popup({
                classCloseBT: 'closeBt',
                imageCloseBT: '../App_Themes/Admin/img/Close.png'
            });
            
            $("#myviewer2").Popup({
                classCloseBT: 'closeBt',
                imageCloseBT: '../App_Themes/Admin/img/Close.png'
            });
        });
    </script>
</asp:Content>
